package cn.edu.tjut.dao.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Repository;

import cn.edu.tjut.bean.StudentBean;
import cn.edu.tjut.dao.StuDao;
import cn.edu.tjut.mapper.StudentBeanMapper;

@Repository("StuInfoDao")
public class StuInfoDao implements StuDao {
	@Resource
	private StudentBeanMapper stuMapper;

	@Override
	public StudentBean selectBystuIndex(String stuIndex) {
		// 根据主键查询学生信息
		return stuMapper.selectBystuIndex(stuIndex);
	}

	@Override
	public List<StudentBean> selectAllstus() {
		// 查询所有学生信息
		return stuMapper.selectAllstus();
	}

	@Override
	public StudentBean selectBystuId(Long stuId) {
		// 根据学号查询学生信息
		return stuMapper.selectBystuId(stuId);
	}

	@Override
	public List<StudentBean> selectStuInfoDynamic(StudentBean stuB) {
		// 动态查询学生信息
		List<StudentBean> lstStu = stuMapper.selectStuInfoDynamic(stuB);
		return lstStu;
	}

	@Override
	public int deleteBystuIndex(StudentBean stuB) {
		// 删除学生信息
		int i = stuMapper.deleteBystuIndex(stuB);
		return i;
	}

	@Override
	public int updateBystuIndex(StudentBean stuB) {
		// 修改学生信息
		int i = stuMapper.updateBystuIndex(stuB);
		return i;
	}

	@Override
	public int insertStuInfo(StudentBean stuB) {
		// 添加学生信息
		int i = stuMapper.insertStuInfo(stuB);
		return i;
	}

}
